package uos.gcds.account;

import uos.gcds.Item;
import uos.gcds.order.stragegy.PricingStrategyFactory;

public class Account extends Item {

	private String id;
	private String passwd;
	private String name;
	private String addr;
	private String jumin;
	private Cart cart;
	private String phone;
	
	public Account(){
		this.setCart(new Cart());
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public String getId() {
		return this.id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return this.name;
	}
	
	public void setJumin(String jumin) {
		this.jumin = jumin;
	}
	
	public String getJumin() {
		return this.jumin;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	public String getPasswd() {
		return this.passwd;
	}
	
	public void setAddr(String addr) {
		this.addr = addr;
	}

	public String getAddr() {
		return this.addr;
	}
	
	public void setCart(Cart cart) {
		this.cart = cart;
	}

	public Cart getCart() {
		return this.cart;
	}
	
	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhone() {
		return this.phone;
	}
	
	
	@Override
	public void updateItem(Item desc) {
	}

	public void clearCart() {
		this.getCart().setAllOrderLineItems(null);
	}

	public void addStrategyToCart() {
		PricingStrategyFactory.getInstance().addCustomerPricingStrategy(this);
	}
}
